package com.zebra.remoting.config;


import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * Command code for rpc remoting command.
 * @author SK
 */
public enum ServerType {

    Gateway(1),
    Tms(2),
    Register(3)
     ;
    private int value;

    ServerType(int value) {
        this.value = value;
    }


    private final static Map<Integer, ServerType> stateMap
            = Arrays.stream(ServerType.values()).collect(Collectors.toMap(ServerType::value, t -> t));


    public int value() {
        return this.value;
    }

    public static ServerType valueOf(int value) {
       return stateMap.get(value);
    }

}